package com.enki.adminplatform.exception;

import com.enki.adminplatform.common.ResultCodeEnum;
import lombok.Data;

/**
 * @author yinyin
 * @create 2021/07/22 下午 6:05
 */
@Data
public class EnkiException extends RuntimeException{
    private Integer code;

    public EnkiException(String message, Integer code) {
        super(message);
        this.code = code;
    }
    public EnkiException(ResultCodeEnum resultCodeEnum){
        super(resultCodeEnum.getMessages());
        this.code= resultCodeEnum.getCode();
    }

    @Override
    public String toString() {
        return "ProjectException{" +
                "code=" + code +
                ",message=" + this.getMessage() +
                '}';
    }
}
